<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .shadow{
            width: 200px;
            height: 200px;
            background-color: rgba(0,0,0,0.5);
            position: absolute;
            left: 100px;
            top: 100px;
        }
    </style>
</head>
<body>
    <div class="shadow"></div>
</body>
<script>
  

    var shadow = document.getElementsByClassName("shadow")[0];

    // 绑定事件方式 => DOM一级绑定 => 赋值式绑定 => 只能给一个元素绑定一个相同类型的事件
    shadow.onclick = function(){
        alert(1111)
    }

    shadow.ondblclick = function(){
        alert(2222)
    }

    // DOM一级绑定  清除方式
    // shadow.onclick = null;
   

</script>
</html>